﻿<%@ Page Language="C#" Inherits="E.Web.Teacher.exam.QuestionEdit" %>
<%@ Import Namespace="E.Model" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
  <title>题库信息</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
  <link rel="stylesheet" href="/css/main.css" type="text/css" media="all" />
  <link rel="stylesheet" href="/css/t_main.css" type="text/css" media="all" />
  <link rel="stylesheet" href="/css/exam.css" type="text/css" media="all" />
  <script type="text/javascript" src="/js/exam.js"></script>
  <script type="text/javascript" src="/js/jquery-1.4.2.min.js"></script>
</head>
<body>
  <form id="form1" method="post" action="" enctype="multipart/form-data">
    <div class="m_top"></div>
    <div class="block_2">
      <div style="width:650px; height:22px;">
        <div class="title">&nbsp;题库信息</div>
      </div>
      <div class="spe_line_2"></div>
      
      <div class="box_1">
        <div class="fl tr left"><span class="hint">*</span>题目：</div>
        <div class="fl"><textarea id="TitleTxt" name="TitleTxt"><%=model.Title%></textarea></div>
      </div>
      <div class="box_1">
        <div class="fl tr left"><span class="hint">*</span>题型：</div>
        <div class="fl">
          <select id="CategorySlt" name="CategorySlt" onchange="SetQuestionCategory(this.value)">
            <option value="-1">请选择题型</option>
            <% if (categoryList != null && categoryList.Count > 0) { %>
              <% foreach (QuestionCategoryModel questionCategory in categoryList) { %>
              <option value="<%=questionCategory.ID %>" title="<%=questionCategory.DefaultScore %>""><%=questionCategory.Name%></option>
              <% } %>
            <% } %>
          </select>
        </div>
        <div class="fl tr left"><span class="hint">*</span>分值：</div>
        <div class="fl"><input type="text" id="ScoreTxt" name="ScoreTxt" value="<%=model.Score%>" /></div>
      </div>
      <div class="box_1">
        <div class="fl tr left">是否为必选题：</div>
        <div class="fl">
          <select id="IsRequiredSlt" name="IsRequiredSlt">
            <option value="0">否</option>
            <option value="1">是</option>
          </select>
        </div>
      </div>
      <div class="box_1">
        <div class="fl tr left">说明：</div>
        <div class="fl"><textarea id="DescriptionTxt" name="DescriptionTxt"><%=model.Description%></textarea></div>
      </div>
      <div class="box_1">
        <div class="fl tr left">知识点：</div>
        <div class="fl"><input type="text" id="KnowledgePointTxt" name="KnowledgePointTxt" value="<%=model.KnowledgePoint%>" style="width:400px;" /></div>
      </div>
      <div class="box_1">
        <div class="fl tr left">题目图片：</div>
        <div class="fl"><input type="file" id="PicFileUpload" name="PicFileUpload" style="width:400px; height:18px;" /></div>
      </div>
      <div class="box_1">
        <div class="fl tr left">题目声音：</div>
        <div class="fl"><input type="file" id="SoundFileUpload" name="SoundFileUpload" style="width:400px; height:18px;" /></div>
      </div>
      
      <div class="box_1">
        <div class="fl tr left"><span class="hint">*</span>课程：</div>
        <div class="fl">
          <select id="CourseSlt" name="CourseSlt">
          <% if (courseList != null && courseList.Count > 0) { %>
            <option value="-1">请选择课程</option>
            <% foreach (System.Collections.Generic.KeyValuePair<int, string> kvp in courseList) { %>
            <option value="<%=kvp.Key %>"><%=kvp.Value%></option>
            <% } %>
          <% } %>
            </select>
        </div>
      </div>
      
      <div class="box_1">
        <div class="fl tr left"><span class="hint">*</span>地区：</div>
        <div class="fl">
          <ul>
          <% if (areaList != null && areaList.Count > 0) { %>
            <% int i = 0; %>
            <% foreach(DictAreaModel areaModel in areaList) { %>
            <li><input type="checkbox" id="AreaChb_<%=i %>" name="AreaChb" class="fl c_chb" value="<%=areaModel.ID%>" /><div class="fl left_2">&nbsp;<%=areaModel.Name%></div></li>
            <% i++; %>
            <% } %>
          <% } %>
          </ul>
        </div>
      </div>
    </div>
    <div class="block" >
      <div id="answerDiv">
        <div style="width:650px; height:22px;">
        <div class="title">&nbsp;选项</div>
        </div>
        <div class="spe_line_2"></div>
        <div class="box_1">
        <div class="fl tr left"><span class="hint">*</span>选项数目：</div>
        <div class="fl">
            <select id="ItemCountSlt" name="ItemCountSlt" onchange="SetItemCount(this.value)">
            </select>
        </div>
        </div>
      
        <% if (model.OptionList != null && count > 0) { %>
        <% int i = 0; %>
        <% foreach (QuestionOptionModel optionModel in model.OptionList) { %>
        <input type="hidden" id="id_<%=i %>" />
        <input type="hidden" id="title_<%=i %>" value="<%=optionModel.OptionTitle %>" />
        <input type="hidden" id="correct_<%=i %>" value="<%=optionModel.IsCorrect ? "1" : "0" %>" />
            <% i++; %>
        <% } %>
        <% } %>
      
        <div id="NewItem"></div>
        <div class="box_1">
        <div class="fl tr left"><span class="hint">*</span>正确答案：</div>
        <div class="fl" id="CorrectChbList">
            <%--<div class="fl left_2">&nbsp;A&nbsp;</div><input type="checkbox" id="c_1" name="chblist" class="fl c_chb" />
            <div class="fl left_2">&nbsp;B&nbsp;</div><input type="checkbox" id="c_2" name="chblist" class="fl c_chb" />
            <div class="fl left_2">&nbsp;C&nbsp;</div><input type="checkbox" id="c_3" name="chblist" class="fl c_chb" />
            <div class="fl left_2">&nbsp;D&nbsp;</div><input type="checkbox" id="c_4" name="chblist" class="fl c_chb" />--%>
        </div>
        </div>
        </div>
        <div style="width:350px; text-align:center; margin:15px 0px 20px -10px;">
            <input type="image" src="/images/btn/confirm.gif" style="width:52px; height:22px;" onclick="return CheckForm();" />
            <% if (act == "u") { %>
            &nbsp;&nbsp;<a href="/exam/QuestionList.aspx"><img alt="" src="/images/btn/back.gif" /></a>
            <% } %>
        </div>

      <input type="hidden" id="act" name="act" value="<%=act %>" />
      <input type="hidden" id="id" name="id" value="<%=id %>" />
      <input type="hidden" id="chk_v" name="chk_v" />
      <input type="hidden" id="area_v" name="area_v" value="<%=area_v %>" />
      <input type="hidden" id="o_p_p" name="o_p_p" value="<%=model.ImgUrl %>" />
      <input type="hidden" id="o_s_p" name="o_s_p" value="<%=model.SoundUrl %>" />
     
    </div>

    <input type="hidden" id="datacount" name="datacount" value="<%=count %>" />
    <script type="text/javascript">
      InitItemCountSlt("ItemCountSlt", <%=count %>);
      SetItemCount(<%=count %>);
      
      <% if (act == "u") { %>
        $("#CourseSlt").val(<%=model.CourseID %>);
        $("#CategorySlt").val(<%=model.CategoryID %>);
        $("#IsRequiredSlt").val('<%=model.IsRequired ? 1 : 0 %>');
        SetQuestionCategory(<%=model.CategoryID %>);
        InitAreaData();
      <% } %>
      
    </script>
    
    <% if (act == "n" && cid != -1) { %>
    <script type="text/javascript">
      $("#CourseSlt").val('<%=cid %>');
    </script>
    <% } %>
  </form>
</body>
</html>
